#ifndef __H03_CONFIG_H__
#define __H03_CONFIG_H__

#include <stdio.h>

#define DEVICE_MODEL "H03pro"

// #define BROKERURL "mqtt://8.217.217.243:1883"
#define BROKERURL "mqtt://mq-iot-h03.hylgeai.cn:1883"
#define HARDWARE_VERSION "250806"

typedef struct {
    uint8_t gesture_mode;
    uint32_t rpt_start;
    uint8_t working_mode;
    uint8_t sending_mode;
    uint16_t sending_period;
    uint8_t touch_mode;
}user_attr_t;
extern user_attr_t user_attr;

typedef struct{
	uint16_t comeandgo_count;
	uint32_t present_state_count;
	uint16_t radar_err_count;
	uint16_t rst_delay;
	uint8_t ble_stop;
    uint8_t sending_attr;
    uint8_t human_attr;
    uint16_t led_tomato_clock;
    uint32_t nextday_leave;
    uint32_t now_sec;
    uint8_t key_password;
    uint8_t gesture_detect;
}timer_count_t;
extern timer_count_t timer_count;

typedef struct {
    bool all_attr;
    bool mqtt_heartbeat;
    bool time_sync;
    bool body_status;    //人体状态
    bool body_movement;  //活跃度
    bool respiratory;    //呼吸率
    bool flow_state;     //心流状态
    bool posture_state;  //姿态状态
    bool activity_freq;  //过去一分钟活动频繁度
    bool body_distance;       //身体位置距离
    bool body_angle;     //身体位置角度
    bool head_pos;       //头位置距离
    bool head_angle;     //头位置角度
    bool hand_pos;       //手位置距离
    bool hand_angle;     //手位置角度
    bool heart_rate;     //心率
    bool position_interval;
    bool study_time;
    bool report;
    bool gesture_mode;
    bool radar_error;
    bool warning_event;
    bool human_attr;
    bool study_time_calculated;
    bool led_break;
    bool reset_key;
    uint8_t led_tomato_clock;
    bool key_password;
    bool gesture;
}event_flag_t;
extern event_flag_t event_flag;

extern void printf_buf(char *tmp_name, uint8_t *tmp_buf, uint8_t tmp_len);
extern void printf_char(char *tmp_name, uint8_t *tmp_buf, uint8_t tmp_len);
extern void user_timer_init(void);
extern void user_event_init(void);

#endif